package org.fu.crowd.api;

import org.fu.crowd.po.Member;
import org.fu.crowd.utils.Common;
import org.fu.crowd.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient("CLOUD-MYSQL-SERVICE")
public interface MySQLRemoteService {


    /**
     *      根据账号查询member
     * @param loginacct
     * @return
     */
    @RequestMapping("/getMember/ByLogin/AcctRemote")
    Common<Member> getMemberPOByLoginAcctRemote(@RequestParam("loginacct") String loginacct);




    /**
     *      保存注册信息
     */
    @RequestMapping("/saveMember/remote")
    Common<String> saveMemberRemote(@RequestBody Member member);


    /**
     * 保存projectVO
     * @param projectVO
     * @param memberId
     * @return
     */
    @RequestMapping("/save/projectVORemote")
    Common<String> saveProjectVORemote(@RequestBody ProjectVO projectVO,@RequestParam("memberId") Integer memberId);


    /**
     * 获取首页数据
     * @return
     */
    @RequestMapping("/get/portalTypeProjectData/remote")
     Common<List<PortalTypeVO>> getPortalTypeProjectDataRemote();



    /**
     *  展示给前台的项目详情
     */
    @RequestMapping("/project/portal/showProjectDetail")
    Common<DetailProjectVO> getPortalShowProjectDetail(@RequestParam("projectId")Integer projectId);



    @RequestMapping("/order/confirmReturnInfo")
    Common<OrderProjectVO> orderConfirmReturnInfo(@RequestParam("projectId") Integer projectId, @RequestParam("returnId")Integer returnId);


    @RequestMapping("/get/AddressVO/Remote")
    Common<List<AddressVO>> getAddressVORemote(@RequestParam("memberId")Integer memberId);


    @RequestMapping("/save/AddressVO/Remote")
    Common<String> saveAddressVORemote(@RequestBody AddressVO addressVO);

    @RequestMapping("/save/Order/Remote")
    Common<String> saveOrderRemote(@RequestBody OrderVO orderVO);
}
